package com.pr.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.pr.beans.News;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.pr.utils.DataResults;
import java.util.List;

@Api(tags = "公告接口")
@RequestMapping("/news")
public interface NewsService  {

    @ApiOperation(value = "公告列表", notes = "公告列表....")
    @GetMapping("list")
    DataResults<List<News>> list();

    @ApiOperation(value = "新增公告", notes = "新增公告....")
    @PostMapping("insertNews")
    DataResults insertNews(@RequestBody News news);

    @ApiOperation(value = "更新公告", notes = "更新公告....")
    @PutMapping("updateNews")
    DataResults updateNews(@RequestBody News news);

    @ApiOperation(value = "根据ID删除公告", notes = "根据ID删除公告....")
    @DeleteMapping("deleteNewsById/{id}")
    DataResults deleteNewsById(@PathVariable("id") Integer id);

    @ApiOperation(value = "根据ID查询公告", notes = "根据ID查询公告....")
    @GetMapping("findNewsById/{id}")
    DataResults<News> findNewsById(Integer id);
}
